export const filterDict = (value: any, options: any[]) => {
  const rowLabel =
    options && options.filter((item) => String(item.value) === String(value))
  return rowLabel && rowLabel[0] && rowLabel[0].label
}

export const filterDataSource = (dataSource: any[], value: any) => {
  if (Array.isArray(value)) {
    return value.map((item) => {
      // console.log(dataSource);
      const rowLabel =
        dataSource && dataSource.find((i) => String(i.value) === String(item))
      return rowLabel?.label
    })
  }
  const rowLabel =
    dataSource &&
    dataSource.find((item) => String(item.value) === String(value))
  return rowLabel?.label
}
